﻿Imports System.IO

Public Class Administration
    Inherits PageTemplate

    Private Sub SystemSettings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Title = "Administration"
        Description = "Select an administrative task below."
        PageIcon = My.Resources.Config

    End Sub

    Private Sub lnkSystemSettings_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkSystemSettings.LinkClicked
        GoToPage(FormTypes.SystemSettings)
    End Sub

    Private Sub lnkAdministration_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkAdministration.LinkClicked
        GoToPage(FormTypes.ArchiveHistory)
    End Sub

    Private Sub lnkAccountMaintenance_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkAccountMaintenance.LinkClicked
        GoToPage(FormTypes.AccountMaintenance)
    End Sub

    Private Sub lnkSecurityMaintenance_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkSecurityMaintenance.LinkClicked
        GoToPage(FormTypes.SecurityMaintenance)
    End Sub

    Private Sub lnkChangeDatabase_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkChangeDatabase.LinkClicked
        Dim setupDatabaseForm As New SetupDatabase(True)
        Dim result As DialogResult = setupDatabaseForm.ShowDialog()
        If result = DialogResult.OK Then
            GoToPage(FormTypes.SystemSettings)
        End If
    End Sub

    Private Sub lnkArchiveUtil_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)
        Dim process As New Diagnostics.Process
        With process.StartInfo
            .FileName = Path.Combine(Application.StartupPath, "ArchiveUtil.exe")
            .UseShellExecute = False
        End With
        process.Start()
    End Sub
End Class
